package Controller.reply;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Dao.ReplyDao;

public class ReplyreplyDeleteController implements Controller{
	private ReplyDao dao;
	public void setDao(ReplyDao dao) {
		this.dao = dao;
	}
	@Override
	public ModelAndView handleRequest(HttpServletRequest req,
			HttpServletResponse arg1) throws Exception {
		Integer sr_no = Integer.parseInt(req.getParameter("sr_no"));
		Integer sr_sb_no = Integer.parseInt(req.getParameter("sb_no"));
		System.out.println("삭제에 들어온 시퀀스 값 : "+sr_no);
		
		dao.replyDelete(sr_no);
		ModelAndView mav = new ModelAndView();
		mav.setViewName("redirect:/sBoardReplyList.reply?sb_no="+sr_sb_no);
		return mav;
	}

}
